package zhongbo.java.air.ingestion.listen;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import zhongbo.java.air.ingestion.config.RedisListenerConfig;

@Component
@Slf4j
public class RedisLogChanelPublisher {
    @Autowired
    private StringRedisTemplate redisTemplate;

    public void publish(String channel, Object message) {
        log.info("\n准备发布消息到频道: " + channel);
//        redisTemplate.convertAndSend(RedisListenerConfig.INJEST_FLIGHT_PATH, message);
        redisTemplate.convertAndSend(channel, message);
        log.info("\n消息已发布到频道: " + channel);
    }

}
